package inter.gui.principal;

import inter.gui.cadastro.JfCliente;
import inter.logico.Autenticacao;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Label;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Dialog.ModalExclusionType;
import java.awt.event.ContainerAdapter;
import java.awt.event.ContainerEvent;

import javax.swing.JOptionPane;
import javax.swing.JToolBar;
import javax.swing.JSpinner;
import javax.swing.JSplitPane;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.AbstractAction;
import java.awt.event.ActionEvent;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JScrollBar;
import javax.swing.JPasswordField;
import javax.swing.JLabel;
import com.jgoodies.forms.factories.DefaultComponentFactory;
import javax.swing.ImageIcon;
import java.awt.Component;
import javax.swing.Box;
import java.awt.CardLayout;
import java.awt.Choice;
import javax.swing.JProgressBar;
import java.awt.event.ActionListener;
import javax.swing.KeyStroke;
import java.awt.event.KeyEvent;
import java.awt.event.InputEvent;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.JSeparator;
import javax.swing.border.BevelBorder;
import javax.swing.border.EtchedBorder;
import javax.swing.border.SoftBevelBorder;
import javax.swing.UIManager;

public class JfMenuPrincipal extends JFrame {

	private JPanel contentPane;
	private final Action action = new SwingAction();

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					
					JfMenuPrincipal frame = new JfMenuPrincipal();
					frame.setVisible(true);
					
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public JfMenuPrincipal() {
		addContainerListener(new ContainerAdapter() {
			@Override
			public void componentAdded(ContainerEvent e) {
			}
		});
		setBounds(100, 100, 1280, 800);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu mnNewMenu = new JMenu("Cadastro");
		menuBar.add(mnNewMenu);
		
		JMenuItem mntmNewMenuItem = new JMenuItem("Cliente");
		mntmNewMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.SHIFT_MASK));
		mntmNewMenuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
		      JfCliente n1 = new JfCliente();
		      n1.setVisible(true);
			}
		});
		mntmNewMenuItem.setIcon(new ImageIcon("/home/jorge/workspace/Inter/icons/adicionar.png"));
		mnNewMenu.add(mntmNewMenuItem);
		
		JMenuItem mntmFornecedor = new JMenuItem("Fornecedor");
		mntmFornecedor.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.SHIFT_MASK));
		mnNewMenu.add(mntmFornecedor);
		
		JMenuItem mntmProduto = new JMenuItem("Produto");
		mntmProduto.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.SHIFT_MASK));
		mnNewMenu.add(mntmProduto);
		
		JMenuItem mntmUsuario = new JMenuItem("Usuario");
		mntmUsuario.setIcon(new ImageIcon("/home/jorge/workspace/Inter/icons/usuario.png"));
		mntmUsuario.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.SHIFT_MASK));
		mnNewMenu.add(mntmUsuario);
		
		JMenuItem mntmsair = new JMenuItem("Sair");
		mntmsair.setIcon(new ImageIcon("/home/jorge/workspace/Inter/icons/sair.png"));
		mntmsair.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.SHIFT_MASK));
		mnNewMenu.add(mntmsair);
		
		JMenu mnRelatorio = new JMenu("Relatorio");
		menuBar.add(mnRelatorio);
		
		JMenuItem mntmCliente = new JMenuItem("Cliente");
		mnRelatorio.add(mntmCliente);
		
		JMenuItem mntmFornecedor_1 = new JMenuItem("Fornecedor");
		mnRelatorio.add(mntmFornecedor_1);
		
		JMenu mnNewMenu_1 = new JMenu("Ajuda");
		menuBar.add(mnNewMenu_1);
		
		JMenuItem mntmGeral = new JMenuItem("Geral");
		mntmGeral.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.SHIFT_MASK));
		mntmGeral.setIcon(new ImageIcon("/home/jorge/workspace/Inter/icons/ajuda.png"));
		mnNewMenu_1.add(mntmGeral);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JPanel panel = new JPanel();
		contentPane.add(panel, BorderLayout.CENTER);
		panel.setLayout(null);
		
		JPanel panel_1 = new JPanel();
		panel_1.setBorder(UIManager.getBorder("CheckBox.border"));
		panel_1.setBounds(0, 700, 1262, 16);
		panel.add(panel_1);
		panel_1.setLayout(null);
		
		JLabel lblHora = new JLabel("");
		lblHora.setBounds(0, 0, 150, 14);
		panel_1.add(lblHora);
		
	}
  
	
	
	

	private class SwingAction extends AbstractAction {
		public SwingAction() {
			putValue(NAME, "SwingAction");
			putValue(SHORT_DESCRIPTION, "Some short description");
		}
		public void actionPerformed(ActionEvent e) {
		}
	}

}